package com.spvs.approval.utils;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

import java.lang.reflect.Type;

public class GsonUtils {

   private static Gson GSON=new GsonBuilder().serializeNulls().disableHtmlEscaping().create();

    public static <T> T jsonToEntity(Type clazz,String json) {
        return GSON.fromJson(json,clazz);
    }

    public static String ObjectToString(Object o){
        return GSON.toJson(o);
    }

    public static Gson bulidGson(){
        return GsonUtils.GSON;
    }
}
